A virtual machine can be a substantially isolated environment that has its own operating system, software applications, and virtualized hardware. For example, a virtual machine can have a virtual Central Processing Unit (vCPU), a virtual Random Access Memory (vRAM), and other components. In some cases, a virtual machine can have a virtual Peripheral Component Interconnect (vPCI) system for attaching virtual hardware devices to the virtual machine. An example of the vPCI system can be a virtual PCI express system. The vPCI system can include several virtual buses connected together by virtual bridges to conceptually form a tree-like structure. Each virtual bridge can directly connect a bus that is positioned immediately above the virtual bridge in the tree-like structure to another bus that is positioned immediately below the virtual bridge in the tree-like structure. The bus that is positioned immediately above the virtual bridge can be referred to as a “primary bus” for the virtual bridge, and the bus that is positioned immediately below the virtual bridge can be refer to as a “secondary bus” for the virtual bridge.
At startup time, the virtual machine (e.g., guest firmware of the virtual machine) can scan the vPCI system to determine the number of virtual buses that are present in the vPCI system. This number can be referred to as the virtual-bus maximum, and represent the maximum number of virtual buses that can be connected to the vPCI system. For example, if there are five virtual buses present in the vPCI system at startup time, the virtual-bus maximum can be 4 (the range from 0 to 4). The virtual-bus maximum can be a fixed value that is unchangeable after the virtual machine starts up. The virtual machine can rely on the virtual-bus maximum to perform a variety of functions.